#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int arr[N], n, k;
int main()
{
	arr[0] = 1;
	cin >> n >> k;
	for (int i = 1; i < k; i++) {
		for (int j = 0; j < i; j++) {
			arr[i] += arr[j];
			arr[i] %= 100003;
		}
	}
	for (int i = k; i <= n; i++) {
		for (int j = i - k; j < i; j++) {
			arr[i] += arr[j];
			arr[i] %= 100003;
		}
	}
	cout << arr[n] << endl;
	return 0;
}